<template>
	<u-modal v-model="show" :show-cancel-button="true" confirm-text="立即登录"
		 @cancel="cancel" @confirm="confirm"
	>
		<view class="u-update-content">
			<rich-text :nodes="content"></rich-text>
		</view>
	</u-modal>
</template>

<script>
	export default {
		data() {
			return {
				show: true,
				// 传递给uni-app"rich-text"组件的内容，可以使用"<br>"进行换行
				content: `
					登录后才可以购买商品哦~
				`,
			}
		},
		onReady() {
			this.show = true;
		},
		methods: {
			cancel() {
				this.closeModal();
			},
			confirm() {
				uni.navigateTo({
					url:"../../pages/login/Login"
				})
			},
			closeModal() {
				setTimeout(()=>{
					uni.switchTab({
						url:"../../pages/home/Home",
					})
				},1000)
			}
		}
	}
</script>

<style scoped lang="scss">
	.u-full-content {
		background-color: #00C777;
	}
	
	.u-update-content {
		font-size: 26rpx;
		color: $u-content-color;
		line-height: 1.7;
		padding: 30rpx;
	}
</style>